import { AccessLevel, SingletonProto } from "@eggjs/tegg";

/**
 * 数组处理工具
 */
@SingletonProto({
    accessLevel: AccessLevel.PUBLIC
})
export class ArrayUtils {

    static getType(v: any) {
        return Object.prototype.toString.call(v).replace(/^\[object (\S+)\]$/, "$1")
    }

    static IsArray(v: any) {
        return this.getType(v) === "Array"
    }
}